package net.sxnic.jhitem.itemclob.action;

import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.sxinfo.core.dao.hibernate3.HibernateCriteria;
import net.sxinfo.core.dao.hibernate3.HibernateDaoUtils;
import net.sxinfo.core.dao.hibernate3.HibernateOrder;
import net.sxinfo.core.util.WebUtils;
import net.sxnic.comm.utils.PropertyUtil;

import org.apache.commons.lang.StringUtils;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

/**
 * @Description:  [一句话描述该类的功能]
 * @Author [姓名] [联系方式]
 * @CreateDate:
 * @UpdateDate:   
 * @Version 1.0
 */
 public class Browse extends ItemClobAction{
	private static final long serialVersionUID = 1L;

	private static Logger logger = LoggerFactory.getLogger(Browse.class);

	public String execute() throws Exception {
		
		 try {						
			    //设置页码
				int pageNumber = WebUtils.getPageNumber(request);
				//设置每页显示条数
				int pageSize = PropertyUtil.findTableSize("firstbrowse.tabsize");
				//设置排序（默认ID）
				HibernateOrder infoCodeOrder = HibernateDaoUtils.createHibernateOrder(
						"id", true);
				//设置查询条件
				HibernateCriteria hc = new HibernateCriteria().add(infoCodeOrder);
				//按XX条件查询示例
				Criterion dc = null;
				dc = Restrictions.ne("xx", "txtxx");
				hc.add(dc);
		 
				itemClobs = itemClobManager.getPageByCriteria(pageNumber, pageSize, hc);
				
			} catch (Exception e) {
				e.printStackTrace();
			}
	  
		return SUCCESS;
	}

}
